class Solution {
public:
    bool uniqueOccurrences(vector<int>& arr) {
        unordered_map<int, int> m;

        for (auto e : arr)
            m[e]++;
        vector<int> a;
        for (auto e : m)
            a.push_back(e.second);
        sort(a.begin(), a.end());
        if (a.size() == 1) return true;
        for (int i = 1; i < a.size(); ++i)
        {
            if (a[i] == a[i - 1]) return false;
        }
        return true;

        for (auto e : m)
        {

        }


    }
};